hvm: Rename injection_pending() to event_injection_faulted().
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 23 Feb 2007 10:35:16 +0000 (10:35 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 23 Feb 2007 10:35:16 +0000 (10:35 +0000)
Fix the VMX and SVM handlers to reflect the new semantics (which is
what is actually required by the one caller, in shadow fault path).
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/mm/shadow/multi.c
xen/include/asm-x86/hvm/hvm.h

index a6dd6307f49df4ec2be361ed918b15dec8e83e51..e68c42fc30346b8b3ba04c768541a231b80f16fb 100644 (file)
@@ -982,10 +982,10 @@ static void svm_hvm_inject_exception(
         v->arch.hvm_svm.vmcb->cr2 = v->arch.hvm_svm.cpu_cr2 = cr2;
 }
 
-static int svm_injection_pending(struct vcpu *v)
+static int svm_event_injection_faulted(struct vcpu *v)
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
-    return (vmcb->vintr.fields.irq || vmcb->exitintinfo.fields.v);
+    return vmcb->exitintinfo.fields.v;
 }
 
 int start_svm(void)
@@ -1064,7 +1064,7 @@ int start_svm(void)
     hvm_funcs.init_ap_context = svm_init_ap_context;
     hvm_funcs.init_hypercall_page = svm_init_hypercall_page;
 
-    hvm_funcs.injection_pending = svm_injection_pending;
+    hvm_funcs.event_injection_faulted = svm_event_injection_faulted;
 
     hvm_enable();
 
index 017a818d1dedc5a6b1b83d9120de0d1dbd9f34a9..3565fdee22cbdbe6db61a9d6059e2c608303ee94 100644 (file)
@@ -990,16 +990,14 @@ static void vmx_update_vtpr(struct vcpu *v, unsigned long value)
     /* VMX doesn't have a V_TPR field */
 }
 
-static int vmx_injection_pending(struct vcpu *v)
+static int vmx_event_injection_faulted(struct vcpu *v)
 {
     unsigned int idtv_info_field;
 
     ASSERT(v == current);
 
     idtv_info_field = __vmread(IDT_VECTORING_INFO_FIELD);
-
-    return (v->arch.hvm_vmx.vector_injected ||
-            (idtv_info_field & INTR_INFO_VALID_MASK));
+    return (idtv_info_field & INTR_INFO_VALID_MASK);
 }
 
 /* Setup HVM interfaces */
@@ -1038,7 +1036,7 @@ static void vmx_setup_hvm_funcs(void)
 
     hvm_funcs.init_hypercall_page = vmx_init_hypercall_page;
 
-    hvm_funcs.injection_pending = vmx_injection_pending;
+    hvm_funcs.event_injection_faulted = vmx_event_injection_faulted;
 }
 
 int start_vmx(void)
index a1748058f9ee1f267d287704a49bbc6d9f9b3080..248e90216be909d2e3c8037d6d68d27d6949d09f 100644 (file)
@@ -2909,7 +2909,7 @@ static int sh_page_fault(struct vcpu *v,
          * stack is currently considered to be a page table, so we should
          * unshadow the faulting page before exiting.
          */
-        if ( unlikely(hvm_injection_pending(v)) )
+        if ( unlikely(hvm_event_injection_faulted(v)) )
         {
             gdprintk(XENLOG_DEBUG, "write to pagetable during event "
                      "injection: cr2=%#lx, mfn=%#lx\n", 
index 57c263a7b5f285cf0ec3b2a403142fbaa9b19d0c..b5ca99f84b2a5a7caea0961cf0dd56425739bc16 100644 (file)
@@ -135,7 +135,7 @@ struct hvm_function_table {
 
     void (*init_hypercall_page)(struct domain *d, void *hypercall_page);
 
-    int  (*injection_pending)(struct vcpu *v);
+    int  (*event_injection_faulted)(struct vcpu *v);
 };
 
 extern struct hvm_function_table hvm_funcs;
@@ -264,9 +264,9 @@ hvm_inject_exception(unsigned int trapnr, int errcode, unsigned long cr2)
 
 int hvm_bringup_ap(int vcpuid, int trampoline_vector);
 
-static inline int hvm_injection_pending(struct vcpu *v)
+static inline int hvm_event_injection_faulted(struct vcpu *v)
 {
-    return hvm_funcs.injection_pending(v);
+    return hvm_funcs.event_injection_faulted(v);
 }
 
 #endif /* __ASM_X86_HVM_HVM_H__ */